<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="box" id="box">哈哈哈</div>
    <div class="box" name="hh">哈哈哈</div>
    <div class="box">哈哈哈</div>
    <div class="box" name="hh">哈哈哈</div>
    <div class="box">哈哈哈</div>
    <script>
        var tagDiv = document.getElementsByTagName("div")
        console.log(tagDiv)
        var idDiv = document.getElementById("box")
        console.log(idDiv)
        var classDiv = document.getElementsByClassName("box")
        console.log(classDiv)
        var queryDiv = document.querySelector("div")
        console.log(queryDiv)
        var nameDiv = document.getElementsByName("hh")
        console.log(nameDiv)
    </script>
</body>
</html>